package fpt.myFileHandler;

import java.io.FileReader;
import java.io.IOException;

import javax.swing.text.BadLocationException;

/**
 * Handler
 * 
 * r25
 * 
 * 12 March 2010
 * 
 * This abstract class is used to create a general file handler type.
 * @author Daniel De Guzman
 *
 */
public abstract class Handler {
	private String[] processedInput;
	private int k;
	private int vCount;
	private String[] vInfoArray;
	private String error;
	
	/**
	 * Specify how an input is processed.
	 * @param in - input file
	 * @return String array containing processed input
	 * @throws IOException
	 * @throws BadLocationException
	 */
	abstract String[] processInput(FileReader in) throws IOException, BadLocationException;
	
	// Setters and Getters
	
	public String[] getProcessedInput() {
		return processedInput;
	}
	
	public void setProcessedInput(String[] processedInput) {
		this.processedInput = processedInput;
	}
	
	public int getK() {
		return k;
	}
	
	public void setK(int k) {
		this.k = k;
	}
	
	public int getvCount() {
		return vCount;
	}
	
	public void setvCount(int vCount) {
		this.vCount = vCount;
	}
	
	public String[] getvInfoArray() {
		return vInfoArray;
	}
	
	public void setvInfoArray(String[] vInfo) {
		this.vInfoArray = vInfo;
	}
	
	public String getError() {
		return error;
	}
	
	public void setError(String error) {
		this.error = error;
	}	
}
